package com.zpark.gmd.jushanpay.common.domain;

import lombok.Data;

@Data
public class PageRequestParams {

    private long startRow;

    private long limit;

    private PageRequestParams(Long startRow, Long limit){
        this.startRow = startRow;
        this.limit = limit;
    }

    public static PageRequestParams of(Integer pageNo, Integer pageSize){
        Long startRow = Long.valueOf((pageNo - 1) * pageSize);
        Long limit = Long.valueOf((pageSize));
        return new PageRequestParams(startRow , limit);
    }

}
